﻿<local:DocumentBase x:Class="WPFExcelReport.DSTWBPACK"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                    xmlns:fd="clr-namespace:Labs.Filtering;assembly=ReflectionStudio.Core"
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
                    xmlns:db="clr-namespace:DSTWBPACK"
                    Height="700" Width="1200" 
                    Title="DSTWBPACK"  
                    >
    <local:DocumentBase.Resources>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <db:SETDSTWBPACK  x:Key="SETUI" />
        <CollectionViewSource   x:Key="vwKUNDADR" Source="{Binding Path=KUNDADR,Source={StaticResource SETUI}}" />
        <CollectionViewSource   x:Key="vwKDSTAMM" Source="{Binding Path=KDSTAMM,Source={StaticResource SETUI}}" />
        <CollectionViewSource   x:Key="vwVKKOPF" Source="{Binding Path=VKKOPF,Source={StaticResource SETUI}}" />
        <CollectionViewSource   x:Key="vwVKPOS" Source="{Binding Path=VKPOS,Source={StaticResource SETUI}}" />
        <CollectionViewSource   x:Key="vwVVTLIEF" Source="{Binding Path=VVTLIEF,Source={StaticResource SETUI}}" />
        <CollectionViewSource   x:Key="vwVVLIEF" Source="{Binding Path=VVLIEF,Source={StaticResource SETUI}}" />
        <CollectionViewSource   x:Key="vwWBBST" Source="{Binding Path=WBBST,Source={StaticResource SETUI}}" />
        <CollectionViewSource   x:Key="vwVVPACK" Source="{Binding Path=VVPACK,Source={StaticResource SETUI}}" />
        <CollectionViewSource   x:Key="vwTBPACK" Source="{Binding Path=TBPACK,Source={StaticResource SETUI}}" />
        <CollectionViewSource   x:Key="vwTXTKON" Source="{Binding Path=TXTKON,Source={StaticResource SETUI}}" />
    </local:DocumentBase.Resources>
    <Grid DataContext="{Binding}">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="2*"/>
            <ColumnDefinition Width="3*" />
        </Grid.ColumnDefinitions>
        <StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2">
            <WrapPanel>
                <Label FontSize="35" Width="Auto" Height="Auto">色光:</Label>
                <TextBox FontSize="35" Height="50" VerticalAlignment="Top" Name="txtShade" Text="{Binding Path=WBBTAX, Source={StaticResource ResourceKey=vwTBPACK}}" Background="Yellow" Width="40"></TextBox>
                <Label FontSize="35" Width="Auto" Height="Auto">布卷:</Label>
                <TextBox FontSize="70" Name="txtWBBSTKNR" Background="Yellow" Width="800" Height="120" CharacterCasing="Upper"  KeyUp="TextBox_KeyUp" TabIndex="1" ></TextBox>
            </WrapPanel>
        </StackPanel>
        <StackPanel Grid.Row="1" Grid.Column="0"  >
            <WrapPanel>
                <Button Margin="0,0,0,0" FontSize="35" Background="Green" Name="btnFinishPack" Click="btnFinishPack_Click" Width="Auto" BorderThickness="5">完成此件</Button>
                <Label FontSize="35" Width="Auto" Height="Auto">件号:</Label>
                <TextBox FontSize="35" Name="txtWBPACKNR" TextChanged="txtWBPACKNR_TextChanged"  Background="Yellow" Width="80">1</TextBox>
                <Label FontSize="35" Width="Auto" Height="Auto">色光</Label>
                <TextBox FontSize="35" Name="txtHistoryShade" Background="Gray" Width="40"></TextBox>
            </WrapPanel>
            <Line Height="10" Fill="#FF170D0D" />
            <WrapPanel Name="ZoneOrder">
                <TextBlock FontSize="15"  Height="Auto" Width="Auto">小花号:</TextBlock>
                <TextBlock   FontSize="35" Name="txtART"  Text="{Binding Path=WBBART, Source={StaticResource ResourceKey=vwTBPACK}}" Width="240" Margin="10,0,0,0"  HorizontalAlignment="Left" Background="Pink" />
                <TextBlock   FontSize="35" Name="txtVAR"  Text="{Binding Path=WBBVAR, Source={StaticResource ResourceKey=vwTBPACK}}" Width="1" Margin="0,0,0,0"  HorizontalAlignment="Left" Background="Green" />
                <TextBlock   FontSize="35" Name="txtCOLOR"  Text="{Binding Path=WBBFARBE, Source={StaticResource ResourceKey=vwTBPACK}}" Width="40" Margin="0,0,0,0"  HorizontalAlignment="Left" Background="Yellow" />
                <TextBlock   FontSize="35" Name="txtFINISH" Text="{Binding Path=WBBBESCHICH, Source={StaticResource ResourceKey=vwTBPACK}}"   Width="40" Margin="0,0,0,0"  HorizontalAlignment="Left" Background="Aqua" />
            </WrapPanel>
            <WrapPanel>
                <TextBlock FontSize="35"  Height="Auto" Width="Auto">订单号:</TextBlock>
                <TextBlock   FontSize="35" Name="txtVKPAUFKRS" Text="{Binding Path=WBBAUFKRS, Source={StaticResource ResourceKey=vwTBPACK}}"   Width="40" Margin="10,0,0,0"  HorizontalAlignment="Left" Background="Pink" />
                <TextBlock   FontSize="35" Name="txtVKPAUFLFD"  Text="{Binding Path=WBBAUFLFD, Source={StaticResource ResourceKey=vwTBPACK}}"  Width="120" Margin="0,0,0,0"  HorizontalAlignment="Left" Background="Green" />
                <TextBlock   FontSize="35" Name="txtVKPAUFPOS"  Text="{Binding Path=WBBAUFPOS, Source={StaticResource ResourceKey=vwTBPACK}}"  Width="60" Margin="0,0,0,0"  HorizontalAlignment="Left" Background="Yellow" />
            </WrapPanel>
            <StackPanel>
                <WrapPanel>
                    <TextBlock  FontSize="18">包装要求：</TextBlock>
                    <TextBlock  Name="txt010" FontSize="18" Text="{Binding Path=TXT010, Source={StaticResource ResourceKey=vwTXTKON}}"  Width="350" Margin="0,0,0,0"  HorizontalAlignment="Left" Background="Yellow" />
                </WrapPanel>
                <WrapPanel>
                    <TextBlock  FontSize="18">成件要求：</TextBlock>
                    <TextBlock   Name="txt020"  FontSize="18" Text="{Binding Path=TXT020, Source={StaticResource ResourceKey=vwTXTKON}}"  Width="350" Margin="0,0,0,0"  HorizontalAlignment="Left" Background="Green" />
                </WrapPanel>
                <WrapPanel>
                    <TextBlock  FontSize="18">交货要求：</TextBlock>
                    <TextBlock Name="txt030"   FontSize="18" Text="{Binding Path=TXT030, Source={StaticResource ResourceKey=vwTXTKON}}"  Width="350" Margin="0,0,0,0"  HorizontalAlignment="Left" Background="Yellow" />
                </WrapPanel>

            </StackPanel>
            <StackPanel>
                <WrapPanel>
                    <Button Margin="0,0,0,0" FontSize="35" Name="btnPrintPackLabel" Click="btnPrintPackLabel_Click" Width="Auto" HorizontalAlignment="Left" >唛头打印</Button>
                    <CheckBox Name="IsAllPcs" FontSize="30" Content="所有件"/>
                    <WrapPanel>
                        <TextBlock   Margin="10,0,0,0" FontSize="35">件长度</TextBlock>
                        <TextBlock Name="txtPackLength"  Margin="10,0,0,0" HorizontalAlignment="Left" FontSize="35"  Width="120">0</TextBlock>
                        <TextBlock Name="txtPackPcs"  Margin="10,0,0,0" HorizontalAlignment="Left" FontSize="35"  Width="120">0</TextBlock>
                    </WrapPanel>
                </WrapPanel>

            </StackPanel>
            <WrapPanel Name="ZoneFTP"
                   Visibility="Hidden">
                <CheckBox FontSize="14"
                      Content="属于管理员"
                      Name="IsBelongs2Admin"></CheckBox>
                <TextBlock FontSize="14"
                       MinWidth="200"
                       Width="Auto"
                       Name="Administration"
                       Background="#FF00AF00"></TextBlock>
                <TextBlock>FTP站点:</TextBlock>
                <TextBox Name="txtFTPSite"
                     Width="Auto"
                     TabIndex="6">192.168.1.102</TextBox>
                <TextBox Name="txtFTPPort"
                     Width="Auto"
                     TabIndex="7">21</TextBox>
                <Label Content="用户名"
                   Width="60"
                   Margin="10,0,0,0"
                   HorizontalAlignment="Left"
                   FontSize="18"
                   VerticalAlignment="Center" />
                <TextBox Name="txtFTPUser"
                     Width="80"
                     Margin="10,0,0,0"
                     Text="sun"
                     HorizontalAlignment="Left"
                     Background="Yellow"
                     FontSize="18"
                     MaxLength="8"
                     AcceptsTab="False"
                     CharacterCasing="Upper"
                     KeyboardNavigation.TabIndex="0"
                     TabIndex="8" />
                <Label Content="密码"
                   Width="40"
                   Margin="10,0,0,0"
                   HorizontalAlignment="Left"
                   FontSize="18"
                   VerticalAlignment="Center" />
                <PasswordBox Name="txtFTPPwd"
                         Width="80"
                         Margin="10,0,0,0"
                         HorizontalAlignment="Left"
                         Background="Yellow"
                         FontSize="18"
                         KeyboardNavigation.TabIndex="1"
                         TabIndex="9" />
                <Button Height="Auto"
                    Margin="10,0,0,0"
                    Name="btnLogFTP"
                    Width="34"
                    Click="btnLogFTP_Click"
                    KeyboardNavigation.TabIndex="2"
                    IsDefault="True"
                    TabIndex="10">
                </Button>
            </WrapPanel>
        </StackPanel>
        <StackPanel  Grid.Row="1" Grid.Column="1">
            <WrapPanel>
                <TextBlock  FontSize="25">订单数量:</TextBlock>
                <TextBlock Name="txtOrderQty" Text="{Binding Path=VKPMENGE1, Source={StaticResource ResourceKey=vwVKPOS}, Converter={StaticResource ResourceKey=d100}}" HorizontalAlignment="Left" FontSize="25" Width="100">0</TextBlock>
                <TextBlock Name="txtUM" Text="{Binding Path=VKPMEEH, Source={StaticResource ResourceKey=vwVKPOS}}" HorizontalAlignment="Left" FontSize="25" Width="40">M</TextBlock>
                <TextBlock  FontSize="25">总长度:</TextBlock>
                <TextBlock Name="txtTTLWBLength" HorizontalAlignment="Left" FontSize="25" Width="80">0</TextBlock>
                <TextBlock  FontSize="25">已包装:</TextBlock>
                <TextBlock Name="txtPackedWBLength" HorizontalAlignment="Left" FontSize="25" Width="80">0</TextBlock>
                <TextBlock  FontSize="25">待包装:</TextBlock>
                <TextBlock Name="txtRestWBLength" HorizontalAlignment="Left" FontSize="25" Width="80">0</TextBlock>
            </WrapPanel>
            <WrapPanel>
                <Button Margin="0,0,0,0" FontSize="25" Background="Yellow" Name="btnRefresh" Click="btnRefresh_Click" Width="Auto" BorderThickness="1">刷新列表</Button>
            </WrapPanel>
            <DataGrid
                    CanUserReorderColumns="True"  
                    CanUserResizeRows="True" 
                    CanUserSortColumns="True"
                    AutoGenerateColumns="False"  
                    EnableRowVirtualization="True"  
                    RowDetailsVisibilityMode="VisibleWhenSelected"
                    HorizontalAlignment="Stretch" 
                    VerticalAlignment="Stretch"
                    IsSynchronizedWithCurrentItem="True" 
                    Opacity="10" 
                    FontSize="18"
                    Visibility="Visible"
                    ItemsSource="{Binding Source={StaticResource ResourceKey=vwTBPACK}}" 
                    Margin="0,2,0,0" 
                    x:Name="dlgTBPACK" >
                <DataGrid.Columns>
                    <DataGridTextColumn Header="件号" Binding="{Binding WBBBEM}"/>
                    <DataGridTextColumn Header="布卷号" Binding="{Binding WBBSTKNR}"/>
                    <DataGridTextColumn Header="色光" Binding="{Binding WBBTAX}"/>
                    <DataGridTextColumn Header="长度" Binding="{Binding WBBISTKLG, Converter={StaticResource ResourceKey=d1000}}"/>
                </DataGrid.Columns>
            </DataGrid  >
            <DataGrid 
                CanUserReorderColumns="True"  
                CanUserResizeRows="True" CanUserSortColumns="True"
                AutoGenerateColumns="False"   
                EnableRowVirtualization="True"  
                FontSize="18"
                RowDetailsVisibilityMode="VisibleWhenSelected" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                IsSynchronizedWithCurrentItem="True" Visibility="Visible"
                ItemsSource="{Binding Source={StaticResource ResourceKey=vwWBBST}}" 
                Margin="0,2,0,0" 
                x:Name="dlgWBBST" >
                <DataGrid.Columns>
                    <DataGridTextColumn Header="件号" Width="60" Binding="{Binding WBBBEM}"/>
                    <DataGridTextColumn Header="色光" Binding="{Binding WBBTAX}"/>
                    <DataGridTextColumn Header="卷号" Binding="{Binding WBBSTKNR}"/>
                    <DataGridTextColumn Header="" Binding="{Binding WBBWAKZ}"/>
                    <DataGridTextColumn Header="小花号" Width="80" Binding="{Binding WBBART}"/>
                    <DataGridTextColumn Header="" Binding="{Binding WBBVAR}"/>
                    <DataGridTextColumn Header="色号" Binding="{Binding WBBFARBE}"/>
                    <DataGridTextColumn Header="后整理" Binding="{Binding WBBBESCHICH}"/>
                    <DataGridTextColumn Header="长度" Binding="{Binding WBBISTKLG, Converter={StaticResource ResourceKey=d1000}}"/>
                </DataGrid.Columns>
            </DataGrid  >
        </StackPanel>
    </Grid>
</local:DocumentBase>